home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Apple IIGS SCSI Driver Shell / SCSI Driver main < prev    next >
Encoding:
Text File  |  1990-09-14  |  36.4 KB  |  1,356 lines  |  [TEXT/MPS ]

  1.  
  2. ;*******************************************************
  3. ;
  4. ;    SCSI Driver Main Driver.
  5. ;
  6. ;    Written by Matt Gulick.        Started May 16,1988
  7. ;
  8. ;    Copyright Apple Computer, Inc. 1988-90
  9. ;
  10. ;*******************************************************
  11.  
  12. ;*******************************************************
  13. ;
  14. ;    This file contains the code segment that is called
  15. ;    when a Device call comes in.  This code is
  16. ;    responsible for checking the validity of the
  17. ;    command, setting the environment and parsing the
  18. ;    call to the desired filter.
  19. ;
  20. ;*******************************************************
  21.  
  22. ;*******************************************************
  23. ;
  24. ;    Revision History:
  25. ;
  26. ;*******************************************************
  27.  
  28. ;    May 16, 1988    File started.
  29. ;    May 17,    1988    DIB Record defined.
  30. ;    June 6,    1988    Main Driver Written.
  31. ;    Jun    10,    1988    Broke down files into links.
  32. ;    Jun    20,    1988    Add comments concerning Registers to the
  33. ;                    routine headers.  Also incorporate
  34. ;                    changes from code review.
  35. ;    July 8,    1988    Added code to allocate Directpage area
  36. ;                    of $100 bytes.
  37. ;    Oct 25,    1988    Modified the default DIB to reflect the
  38. ;                    changes in the SCSI Manager Interface.
  39. ;                    Also made changes in the code to account
  40. ;                    for this.
  41. ;
  42. ;    Apr    10,    1989    Started code for character devices.
  43. ;
  44.  
  45.                 STRING        PASCAL
  46.                 BLANKS        OFF
  47.                 PAGESIZE    70
  48.                 PRINT        NOGEN
  49.                 PRINT        NOMDIR
  50.                 MACHINE        M65816
  51.  
  52.                 IMPORT        startup
  53.                 IMPORT        Open
  54.                 IMPORT        Read
  55.                 IMPORT        Write
  56.                 IMPORT        Close
  57.                 IMPORT        Status
  58.                 IMPORT        Control
  59.                 IMPORT        Flush
  60.                 IMPORT        Shutdown
  61.                 IMPORT        g_dib_ptr
  62.  
  63.                 ENTRY        default_dib
  64.                 ENTRY        direct_page        ;Driver Mgmt
  65.                 ENTRY        exit_dpage        ;Driver Mgmt
  66.                 ENTRY        gsos_dpage        ;Driver Mgmt
  67.                 ENTRY        lst_rslt_ec        ;Status
  68.                 ENTRY        lst_rslt_id
  69.                 ENTRY        lst_rslt_stat
  70.                 ENTRY        lst_rslt_skey
  71.                 ENTRY        lst_rslt_info
  72.                 ENTRY        lst_rslt_rqlen
  73.                 ENTRY        lst_rslt_scode
  74.                 ENTRY        auto_sense_data    ;Main Driver
  75.  
  76.                 EJECT
  77.  
  78.                 INCLUDE        'scsihd.equates'
  79.  
  80.                 PRINT        OFF
  81.                 INCLUDE        'M16.MEMORY'
  82.                 INCLUDE        'M16.UTIL'
  83.                 PRINT        ON
  84.             
  85. ;*******************************************************
  86. ;
  87. ;    This dummy Procedure is used to inform the loader.
  88. ;    Drivers start with data but are not data segments.
  89. ;    The loader may load what it thinks to be a data
  90. ;    segment accross bank boundries.  This is not good
  91. ;    for code.
  92. ;
  93. ;*******************************************************
  94.  
  95.                 EXPORT    dummy
  96. dummy            PROC
  97.                 ENDP
  98.             
  99. ;*******************************************************
  100. ;
  101. ;    Header as required by the device dispatcher for
  102. ;    drivers.
  103. ;
  104. ;*******************************************************
  105.  
  106.                 EXPORT    start
  107. start            PROC
  108.  
  109.                 dc.w    default_dib-start
  110.                 dc.w    $0001
  111.                 dc.w    ctrl_list-start
  112.                 
  113. ctrl_list        dc.l    null
  114.                 dc.l    null
  115.  
  116.                 ENDP
  117.             
  118. ;*******************************************************
  119. ;
  120. ;    Main entry to the SCSI Driver code segment.  The
  121. ;    state of the machine at this point is:
  122. ;
  123. ;        Acc                =    Call Number
  124. ;                    $0000    =    Startup
  125. ;                    $0001    =    Open
  126. ;                    $0002    =    Read
  127. ;                    $0003    =    Write
  128. ;                    $0004    =    Close
  129. ;                    $0005    =    Status
  130. ;                    $0006    =    Control
  131. ;                    $0007    =    Flush
  132. ;                    $0008    =    Shutdown
  133. ;        Y register        =    Unspecified
  134. ;        X register        =    Unspecified
  135. ;        P register        =    0=M=X=e
  136. ;        Direct Page        =    GS/OS Direct Page
  137. ;        Data Bank        =    Unspecified
  138. ;        Stack Pointer    =    GS/OS Stack
  139. ;        System Speed    =    Fast
  140. ;
  141. ;*******************************************************
  142.  
  143.                 EXPORT    drvr_main
  144. drvr_main        PROC
  145.                                         ;
  146.                                         ; Preserve Callers Data Bank
  147.                                         ; and set ours.
  148.                                         ;
  149.                 phb
  150.                 phk
  151.                 plb
  152.                                         ;
  153.                                         ; Check to see if we have our own
  154.                                         ; Direct Page. If so then copy first
  155.                                         ; 'x' bytes to our temp, switch DP and
  156.                                         ; copy it back to ours.
  157.                                         ;
  158.                 ldx        |direct_page
  159.                 beq        @chk_startup    ;No DP. This must be a startup call.
  160.                                         ;
  161.                                         ; Set our Direct Page with the first
  162.                                         ; 'x' Bytes equal to the GS/OS DP
  163.                                         ; settings.
  164.                                         ;
  165.                 pha
  166.                                         ;
  167.                 clc                        ; Calculate Source Address of GS/OS
  168.                 tdc                        ; Direct Page that we want.
  169.                 sta        |gsos_dpage        ; Preserving GS/OS DP for later use.
  170.                 adc        #dev_num
  171.                 pea        $0000
  172.                 pha
  173.                                         ;
  174.                 clc                        ; Calculate Destination Address of
  175.                 lda        |direct_page    ; our Direct Page that we want.
  176.                 adc        #dev_num
  177.                 pea        $0000
  178.                 pha
  179.                 
  180.                 pushlong    #dib_ptr+4    ;Length of the move
  181.                 
  182.                 pushword    #move_sinc_dinc
  183.  
  184.                 jsl        move_info        ;Move the data
  185.                                         ;
  186.                                         ; Set our Direct Page.
  187.                                         ;
  188.                 lda        |direct_page
  189.                 tcd
  190.                                         ;
  191.                                         ; Continue with call.
  192.                                         ;
  193.                 pla
  194.                 bra        @do_command
  195.                                         ;
  196.                                         ; Validate for Startup Command.
  197.                                         ;
  198. @chk_startup    cmp        #cmd_start
  199.                 bne        @error1
  200.                                         ;
  201.                                         ; Convert call number in Acc
  202.                                         ; to an index into our jmp table
  203.                                         ;
  204. @do_command        cmp        #max_d_cmd+1
  205.                 bge        @error
  206. @do_cmd1        asl        a
  207.                 tax
  208.                                         ;
  209.                                         ; If this is a status call $0005
  210.                                         ; then don't clear these values.
  211.                                         ; That's what they are trying to
  212.                                         ; get.
  213.                                         ;
  214.                 cmp        #cmd_status*2    ;Account for the ASL
  215.                 bne        @clear            ;Not a status call
  216.                 lda        <stat_code        ;Is it Code $0005?
  217.                 cmp        #$0005
  218.                 beq        @dont_clear        ;Yes. Skip the clear code.
  219.                                         ;
  220.                                         ; Clear the data from the last call.
  221.                                         ;
  222. @clear            lda        <dev_num
  223.                 sta        |lst_rslt_id
  224.                                         ;
  225.                                         ; Check to see if device is still
  226.                                         ; performing the last call isued.
  227.                                         ;
  228. @dont_clear        ldy        #dib.dvcflag
  229.                 lda        [dib_ptr],y
  230.                 and        #int_busy
  231.                 beq        @do_call
  232.                                         ;
  233.                                         ; Still Busy.  Return Busy Error.
  234.                                         ;
  235.                 lda        |gsos_dpage
  236.                 tcd
  237.  
  238.                 lda        #drvr_busy
  239.                 bra        @error2
  240.  
  241. @do_call        jsr        (@table,x)
  242.                                         ;
  243.                                         ; Clean Exit.
  244.                                         ;
  245.                                         ; Get our Direct Page with the first
  246.                                         ; 'x' Bytes equal to the GS/OS DP
  247.                                         ; settings and return them.
  248.                                         ;
  249.                 pha
  250.                 php
  251.                                         ;
  252.                                         ; Check to see if premature termination.
  253.                                         ;
  254.                 lda        |exit_dpage
  255.                 beq        @purge_me        ;Hurt Me! I Like it.
  256.                                         ;
  257.                                         ; No. Then Return Control of the
  258.                                         ; Direct Page back to GS/OS.
  259.                                         ;
  260.                 clc                        ; Calculate Source Address of
  261.                 adc        #dev_num        ; our Direct Page that we used.
  262.                 pea        $0000
  263.                 pha
  264.  
  265.                 clc                        ; Calculate Destination Address of
  266.                 lda        |gsos_dpage        ; GS/OS Direct Page.
  267.                 tcd                        ; Resetting it also at this time.
  268.                 adc        #dev_num        ; Preserving GS/OS DP for later use.
  269.                 pea        $0000
  270.                 pha
  271.                 
  272.                 pushlong    #dib_ptr    ;Length of the move
  273.                 
  274.                 pushword    #move_sinc_dinc
  275.  
  276.                 jsl        move_info        ;Return the data
  277.  
  278.                                         ;
  279.                                         ; If Direct_page = 0 then this is
  280.                                         ; the final exit and we need to also
  281.                                         ; zero out the exit_dpage value.
  282.                                         ;
  283.                 lda        |direct_page
  284.                 bne        @purge_me
  285.                 stz        |exit_dpage
  286.  
  287. @purge_me        plp
  288.                 pla
  289.                 plb
  290.                 bcs        @yes_error
  291.                 lda        #null
  292. @yes_error        rtl
  293.                                         ;
  294.                                         ; Error Exit
  295.                                         ;
  296.                                         ; Reset GS/OS Direct Page.
  297.                                         ;
  298. @error            lda        |gsos_dpage
  299.                 tcd
  300. @error1            lda        #drvr_bad_code
  301. @error2            sec
  302.                 plb
  303.                                         ;
  304.                                         ; Save Error Code for Get Last
  305.                                         ; Result Call
  306.                                         ;
  307.                 sta        |lst_rslt_ec
  308.                 rtl
  309.             
  310. ;*******************************************************
  311. ;
  312. ;    Jump table and code.
  313. ;
  314. ;*******************************************************
  315.  
  316. @table            dc.w    startup
  317.                 dc.w    Open
  318.                 dc.w    Read
  319.                 dc.w    Write
  320.                 dc.w    Close
  321.                 dc.w    Status
  322.                 dc.w    Control
  323.                 dc.w    Flush
  324.                 dc.w    Shutdown
  325.  
  326.  
  327.                 EJECT
  328.                                         ;
  329.                                         ; Dispatcher Routing routine
  330.                                         ;
  331.                 EXPORT    rout2_s_disp
  332. rout2_s_disp    pha
  333.  
  334.                 lda        |direct_page    ;If this is the first time, then
  335.                 bne        @use_ours
  336.  
  337.                 pla
  338.                 jsl        s_dispatch
  339.                 rts
  340.  
  341. @use_ours        lda        |gsos_dpage
  342.                 tcd
  343.                 pla
  344.                 jsl        s_dispatch
  345.                 pha
  346.                 lda        |direct_page
  347.                 tcd
  348.                 pla
  349.                 rts
  350.  
  351.                 ENDP
  352.  
  353.                 EJECT
  354.             
  355. ;*******************************************************
  356. ;
  357. ;    The following statements are used to define the DIB
  358. ;    structure.  The structure contains the traditional
  359. ;    DIB followed by an extension used for device
  360. ;    maintainence.  All together each DIB with the
  361. ;    associated extensions will take one page of RAM.
  362. ;
  363. ;*******************************************************
  364. ;
  365. ;    $00    ------------------------------------------------
  366. ;        |                                               |
  367. ;        |      Device Information Block Data (DIB)     |
  368. ;    $3F    |                                               |
  369. ;        ------------------------------------------------
  370. ;    $40    |             Physical Block Number            |
  371. ;        |                                               |
  372. ;    $43    |        that maps to logical block zero       |
  373. ;        ------------------------------------------------
  374. ;    $44    |                                               |
  375. ;        |                 Head Pointer                 |
  376. ;    $47    |                                               |
  377. ;        ------------------------------------------------
  378. ;    $48    |                                               |
  379. ;        |               Forward Pointer                |
  380. ;    $4B    |                                               |
  381. ;        ------------------------------------------------
  382. ;    $4C    |                Memory DIB Count               |
  383. ;        ------------------------------------------------
  384. ;    $4E    |            Partition Map Block Number           |
  385. ;        ------------------------------------------------
  386. ;    $50    |                                               |
  387. ;        |      Memory Manager Handle for this DIB      |
  388. ;    $53    |                                               |
  389. ;        ------------------------------------------------
  390. ;    $54    |                                               |
  391. ;        |              Block Size (Bytes)              |
  392. ;    $57    |                                               |
  393. ;        ------------------------------------------------
  394. ;    $58    |       Max SCSI Command for this Device       |
  395. ;        ------------------------------------------------
  396. ;    $5A    |                                              |
  397. ;        |   Command Bitmap (See ERS for description)   |
  398. ;    $79    |                                              |
  399. ;        ------------------------------------------------
  400. ;    $7A    |              SCSI Command Data               |
  401. ;        |                     and                      |
  402. ;    $D9    |      SCSI Manager Call Buffer Structures     |
  403. ;        ------------------------------------------------
  404. ;    $DA    |            'Busy' and other Flags            |
  405. ;        ------------------------------------------------
  406. ;    $DC    |                                              |
  407. ;        |          Completion Vector with Code         |
  408. ;    $FF    |                                              |
  409. ;        ------------------------------------------------
  410. ;
  411. ;*******************************************************
  412.  
  413.             EXPORT    default_dib
  414. default_dib    PROC
  415.                                     ;
  416.                                     ; Definition of DIB Structure.
  417.                                     ;
  418.             dc.l    $00000000        ; DIB Link Pointer                (LONG)
  419.             dc.l    drvr_main        ; Pointer to Drvrs Main Entry    (LONG)
  420.  
  421. ;-------------------------------------------------------------------------------
  422.  
  423.             IF        scsi_dtype = direct_acc    THEN
  424.  
  425. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  426.  
  427.             IF        warm_ss_suprt = true        THEN
  428.  
  429.             dc.w    restartable++\    ;Restartable from ram    if Set    (WORD)
  430.                     speed_ind++\    ;Device is speed ind    if Set
  431.                     blk_device++\    ;Block Device            if Set
  432.                     write_allow++\    ;Write is Allowed        if Set
  433.                     read_allow++\    ;Read is Allowed        if Set
  434.                     format_allow    ;Format is Allowed        if Set
  435.  
  436.             ELSE
  437.  
  438. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  439.  
  440.             dc.w    speed_ind++\    ;Device is speed ind    if Set    (WORD)
  441.                     blk_device++\    ;Block Device            if Set
  442.                     write_allow++\    ;Write is Allowed        if Set
  443.                     read_allow++\    ;Read is Allowed        if Set
  444.                     format_allow    ;Format is Allowed        if Set
  445.  
  446.             ENDIF
  447.  
  448. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  449.  
  450.             ENDIF
  451.  
  452. ;-------------------------------------------------------------------------------
  453.  
  454.                                     ;
  455.                                     ; Is it a Write-once Read-multiple Device.
  456.                                     ;
  457.             IF        scsi_dtype = apple_cd    THEN
  458.  
  459. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  460.  
  461.             IF        warm_ss_suprt = true        THEN
  462.  
  463.             dc.w    restartable++\    ;Restartable from ram    if Set    (WORD)
  464.                     speed_ind++\    ;Device is speed ind    if Set
  465.                     blk_device++\    ;Block Device            if Set
  466.                     read_allow        ;Read is Allowed        if Set
  467.  
  468.             ELSE
  469.  
  470. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  471.  
  472.             dc.w    speed_ind++\    ;Device is speed ind    if Set    (WORD)
  473.                     blk_device++\    ;Block Device            if Set
  474.                     read_allow        ;Read is Allowed        if Set
  475.  
  476.             ENDIF
  477.  
  478. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  479.  
  480.             ENDIF
  481.  
  482. ;-------------------------------------------------------------------------------
  483.  
  484.                                     ;
  485.                                     ; Is it an MCD 40 Tape Drive
  486.                                     ;
  487.             IF        scsi_dtype = mcd_40    THEN
  488.  
  489. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  490.  
  491.             IF        warm_ss_suprt = true        THEN
  492.  
  493.             dc.w    restartable++\    ;Restartable from ram    if Set    (WORD)
  494.                     speed_ind++\    ;Device is speed ind    if Set
  495.                     blk_device++\    ;Block Device            if Set
  496.                     write_allow++\    ;Write is Allowed        if Set
  497.                     read_allow++\    ;Read is Allowed        if Set
  498.                     format_allow    ;Format is Allowed        if Set
  499.  
  500.             ELSE
  501.  
  502. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  503.  
  504.             dc.w    speed_ind++\    ;Device is speed ind    if Set    (WORD)
  505.                     blk_device++\    ;Block Device            if Set
  506.                     write_allow++\    ;Write is Allowed        if Set
  507.                     read_allow++\    ;Read is Allowed        if Set
  508.                     format_allow    ;Format is Allowed        if Set
  509.  
  510.             ENDIF
  511.  
  512. ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  513.  
  514.              ENDIF
  515.  
  516. ;-------------------------------------------------------------------------------
  517.  
  518.             IF        scsi_dtype = scanner    THEN
  519.                                     ;
  520.                                     ; Is it a Scanner Device?
  521.                                     ;
  522.             dc.w    speed_ind++\    ;Device is speed ind    if Set
  523.                     read_allow        ;Read is Allowed        if Set
  524.  
  525.              ENDIF
  526.  
  527. ;-------------------------------------------------------------------------------
  528.  
  529.             dc.l    $00000000        ; Block Count for this device    (LONG)
  530.                                     ; Set to default. This can change
  531.                                     ;
  532.                                     ; Length of Descriptive Name    (PSTR)
  533.                                     ; Followed by the Descriptive
  534.                                     ; Name for the device.  This
  535.                                     ; is a conditional Assembly.
  536.                                     ;
  537.  
  538. ;-------------------------------------------------------------------------------
  539.  
  540.             IF        scsi_dtype = direct_acc    THEN
  541.                                     ;
  542.                                     ; Is it a Direct-Access Device.
  543.                                     ;
  544.             dc.b    'SCSIHD.00.00'
  545.             ENDIF
  546.  
  547. ;-------------------------------------------------------------------------------
  548.  
  549.             IF        scsi_dtype = seq_acc    THEN
  550.                                     ;
  551.                                     ; Is it a Sequential-Access Device.
  552.                                     ;
  553.             dc.b    'SCSITAPE.00.00'
  554.             ENDIF
  555.  
  556. ;-------------------------------------------------------------------------------
  557.  
  558.             IF        scsi_dtype = print_dvc    THEN
  559.                                     ;
  560.                                     ; Is it a Printer Device.
  561.                                     ;
  562.             dc.b    'SCSIPRINTER.00.00'
  563.             ENDIF
  564.  
  565. ;-------------------------------------------------------------------------------
  566.  
  567.             IF        scsi_dtype = proc_dvc    THEN
  568.                                     ;
  569.                                     ; Is it a Processor Device.
  570.                                     ;
  571.             dc.b    'SCSIPROC.00.00'
  572.             ENDIF
  573.  
  574. ;-------------------------------------------------------------------------------
  575.  
  576.             IF        scsi_dtype = worm_dvc    THEN
  577.                                     ;
  578.                                     ; Is it a Write-once Read-multiple Device.
  579.                                     ;
  580.             dc.b    'SCSIWORM.00.00'
  581.             ENDIF
  582.  
  583. ;-------------------------------------------------------------------------------
  584.  
  585.             IF        scsi_dtype = read_dacc    THEN
  586.                                     ;
  587.                                     ; Is it a Read-only Direct-Access Device.
  588.                                     ;
  589.             dc.b    'SCSICDROM.00.00'
  590.             ENDIF
  591.  
  592. ;-------------------------------------------------------------------------------
  593.  
  594.             IF        scsi_dtype = scanner    THEN
  595.                                     ;
  596.                                     ; Is it a Scanner Device.
  597.                                     ;
  598.             dc.b    'SCSISCANNER.00.00'
  599.             ENDIF
  600.  
  601. ;-------------------------------------------------------------------------------
  602.  
  603.             IF        scsi_dtype = optic_mem    THEN
  604.                                     ;
  605.                                     ; Is it a Optical Memory Device.
  606.                                     ;
  607.             dc.b    'SCSIOPTICAL.00.00'
  608.             ENDIF
  609.  
  610. ;-------------------------------------------------------------------------------
  611.  
  612.             IF        scsi_dtype = changer    THEN
  613.                                     ;
  614.                                     ; Is it a Changer Device.
  615.                                     ;
  616.             dc.b    'SCSICHANGER.00.00'
  617.             ENDIF
  618.  
  619. ;-------------------------------------------------------------------------------
  620.  
  621.             IF        scsi_dtype = comm_dvc    THEN
  622.                                     ;
  623.                                     ; Is it a Communication Device.
  624.                                     ;
  625.             dc.b    'SCSICOM.00.00'
  626.             ENDIF
  627.  
  628. ;-------------------------------------------------------------------------------
  629.  
  630.             IF        scsi_dtype = mcd_40    THEN
  631.                                     ;
  632.                                     ; Is it a Direct Access Magnetic
  633.                                     ; Tape Device.
  634.                                     ;
  635.             dc.b    'SCSITAPE.00.00'
  636.             ENDIF
  637.  
  638. ;-------------------------------------------------------------------------------
  639.  
  640.                                     ;
  641.                                     ; Pad space to fill gap to next field.
  642.                                     ;
  643.             dcb.b    dib.slotnum+default_dib-*,$20
  644.             
  645.             dc.w    $8000            ; Device Slot Number from MGR.    (WORD)
  646.                                     ; By setting bit 15 in the slot
  647.                                     ; number we can force the device
  648.                                     ; dispatcher to keep it around.
  649.                                     ; We will save this as a default
  650.                                     ; dib.  This will also allow us
  651.                                     ; to remain loaded if there are
  652.                                     ; no devices available at boot
  653.                                     ; time.
  654.                                     ;
  655.             dc.w    $0000            ; Device Unit Number from MGR.    (WORD)
  656.             dc.w    drvr_vers        ; Version Number for our Driver    (WORD)
  657.  
  658. ;-------------------------------------------------------------------------------
  659.  
  660.             IF        scsi_dtype = direct_acc    THEN
  661.             dc.w    $0005            ; ID of Device we talk to        (WORD)
  662.             ENDIF
  663.  
  664. ;-------------------------------------------------------------------------------
  665.  
  666.             IF        scsi_dtype = apple_cd    THEN
  667.             dc.w    $0007            ; ID of Device we talk to        (WORD)
  668.             ENDIF
  669.  
  670. ;-------------------------------------------------------------------------------
  671.  
  672.             IF        scsi_dtype = mcd_40    THEN
  673.             dc.w    $0006            ; ID of Device we talk to        (WORD)
  674.             ENDIF
  675.  
  676. ;-------------------------------------------------------------------------------
  677.  
  678.             IF        scsi_dtype = scanner    THEN
  679.             dc.w    $001A            ; ID of Device we talk to        (WORD)
  680.             ENDIF
  681.  
  682. ;-------------------------------------------------------------------------------
  683.  
  684.             dc.w    $0000            ; Head Device Link                (WORD)
  685.             dc.w    $0000            ; Forward Device Link            (WORD)
  686.                                     ;
  687.                                     ; Pointer to DIB Extension        (LONG)
  688.                                     ;
  689.             dc.l    dib.start_blk+default_dib
  690.             
  691.             dc.w    $0000            ; DIB Device Number                (WORD)
  692.                                     ;
  693.                                     ; The Starting Block Number for this device
  694.                                     ; is maintained here.  This is used to
  695.                                     ; modify the requested block number from
  696.                                     ; a logical to a physical number.
  697.                                     ;
  698.             dc.l    $00000000        ; Starting Physical Block Num.    (LONG)
  699.                                     ;
  700.                                     ; These two pointers are the compliment
  701.                                     ; to the links in the standard DIB and
  702.                                     ; will point to the actual DIB referenced
  703.                                     ; in the Head and Forward Device Links.
  704.                                     ;
  705.             dc.l    null            ; Head Dvc Pointer                (LONG)
  706.             dc.l    null            ; Forward Dvc Pointer            (LONG)
  707.             dc.w    null            ; Number of active dibs in mem    (WORD)
  708.             dc.w    null            ; Reserved                        (WORD)
  709.                                     ;
  710.                                     ; Memory Manager Handle
  711.                                     ;
  712.             dc.l    $00000000        ;                                (LONG)
  713.                                     ;
  714.                                     ; Block Size
  715.                                     ;
  716.             dc.l    block_size        ;                                (LONG)
  717.                                     ;
  718.                                     ; Maximum SCSI Command supported by
  719.                                     ; the device for this DIB.
  720.                                     ;
  721.             dc.w    $00FF            ;                                (WORD)
  722.                                     ;
  723.                                     ; SCSI Command Group Bitmaps used as defaults
  724.                                     ; when device does not return this info in the
  725.                                     ; INQUIRY Command.
  726.                                     ;
  727.  
  728. ;-------------------------------------------------------------------------------
  729.  
  730.             IF        scsi_dtype = direct_acc    THEN
  731.                                     ;
  732.                                     ; It is a Direct-Access Device.
  733.                                     ;
  734.             dc.B    $D9,$B0,$27,$BE    ; Group 0                        (LONG)
  735.             dc.B    $04,$03,$1E,$FB    ; Group 1                        (LONG)
  736.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  737.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  738.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  739.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  740.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  741.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  742.             ENDIF
  743.  
  744. ;-------------------------------------------------------------------------------
  745.  
  746.             IF        scsi_dtype = seq_acc    THEN
  747.                                     ;
  748.                                     ; It is a Sequential-Access Device.
  749.                                     ;
  750.             dc.B    $D4,$B1,$FF,$FF    ; Group 0                        (LONG)
  751.             dc.B    $00,$10,$08,$78    ; Group 1                        (LONG)
  752.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  753.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  754.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  755.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  756.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  757.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  758.             ENDIF
  759.  
  760. ;-------------------------------------------------------------------------------
  761.  
  762.             IF        scsi_dtype = print_dvc    THEN
  763.                                     ;
  764.                                     ; It is a Printer Device.
  765.                                     ;
  766.             dc.B    $98,$30,$AF,$9C    ; Group 0                        (LONG)
  767.             dc.B    $00,$00,$00,$00    ; Group 1                        (LONG)
  768.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  769.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  770.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  771.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  772.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  773.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  774.             ENDIF
  775.  
  776. ;-------------------------------------------------------------------------------
  777.  
  778.             IF        scsi_dtype = proc_dvc    THEN
  779.                                     ;
  780.                                     ; It is a Processor Device.
  781.                                     ;
  782.             dc.B    $90,$A0,$20,$8C    ; Group 0                        (LONG)
  783.             dc.B    $00,$00,$00,$00    ; Group 1                        (LONG)
  784.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  785.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  786.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  787.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  788.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  789.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  790.             ENDIF
  791.  
  792. ;-------------------------------------------------------------------------------
  793.  
  794.             IF        scsi_dtype = worm_dvc    THEN
  795.                                     ;
  796.                                     ; It is a Write-once Read-multiple Device.
  797.                                     ;
  798.             dc.B    $D1,$90,$27,$BE    ; Group 0                        (LONG)
  799.             dc.B    $04,$03,$10,$60    ; Group 1                        (LONG)
  800.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  801.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  802.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  803.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  804.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  805.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  806.             ENDIF
  807.  
  808. ;-------------------------------------------------------------------------------
  809.  
  810.             IF        scsi_dtype = read_dacc    THEN
  811.                                     ;
  812.                                     ; It is a Read-only Direct-Access Device.
  813.                                     ;
  814.             dc.B    $D0,$90,$27,$BE    ; Group 0                        (LONG)
  815.             dc.B    $04,$01,$10,$60    ; Group 1                        (LONG)
  816.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  817.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  818.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  819.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  820.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  821.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  822.             ENDIF
  823.  
  824. ;-------------------------------------------------------------------------------
  825.  
  826.             IF        scsi_dtype = scanner    THEN
  827.                                     ;
  828.                                     ; It is a Scanner Device.
  829.                                     ;
  830.             dc.B    $90,$00,$27,$BC    ; Group 0                        (LONG)
  831.             dc.B    $0C,$A0,$48,$78    ; Group 1                        (LONG)
  832.             dc.B    $00,$0C,$04,$20    ; Group 2                        (LONG)
  833.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  834.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  835.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  836.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  837.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  838.             ENDIF
  839.  
  840. ;-------------------------------------------------------------------------------
  841.  
  842.             IF        scsi_dtype = optic_mem    THEN
  843.                                     ;
  844.                                     ; It is a Optical Memory Device.
  845.                                     ;
  846.             dc.B    $D9,$B0,$27,$BE    ; Group 0                        (LONG)
  847.             dc.B    $04,$0F,$1E,$FC    ; Group 1                        (LONG)
  848.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  849.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  850.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  851.             dc.B    $00,$AF,$11,$04    ; Group 5                        (LONG)
  852.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  853.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  854.             ENDIF
  855.  
  856. ;-------------------------------------------------------------------------------
  857.  
  858.             IF        scsi_dtype = changer    THEN
  859.                                     ;
  860.                                     ; It is a Changer Device.
  861.                                     ;
  862.             dc.B    $90,$00,$20,$8C    ; Group 0                        (LONG)
  863.             dc.B    $00,$00,$00,$80    ; Group 1                        (LONG)
  864.             dc.B    $00,$00,$04,$21    ; Group 2                        (LONG)
  865.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  866.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  867.             dc.B    $06,$00,$00,$00    ; Group 5                        (LONG)
  868.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  869.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  870.             ENDIF
  871.  
  872. ;-------------------------------------------------------------------------------
  873.  
  874.             IF        scsi_dtype = comm_dvc    THEN
  875.                                     ;
  876.                                     ; It is a Communication Device.
  877.                                     ;
  878.             dc.B    $90,$A0,$24,$2C    ; Group 0                        (LONG)
  879.             dc.B    $00,$00,$00,$18    ; Group 1                        (LONG)
  880.             dc.B    $00,$00,$00,$00    ; Group 2                        (LONG)
  881.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  882.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  883.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  884.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  885.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  886.             ENDIF
  887.  
  888. ;-------------------------------------------------------------------------------
  889.  
  890.             IF        scsi_dtype = mcd_40    THEN
  891.                                     ;
  892.                                     ; It is a Direct Access Magnetic
  893.                                     ; Tape Device.
  894.                                     ;
  895.             dc.B    $DF,$77,$FF,$7C    ; Group 0                        (LONG)
  896.             dc.B    $04,$00,$01,$18    ; Group 1                        (LONG)
  897.             dc.B    $00,$00,$00,$00    ; Group 2                        (LONG)
  898.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  899.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  900.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  901.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  902.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  903.             ENDIF
  904.  
  905. ;-------------------------------------------------------------------------------
  906.  
  907.             IF        scsi_dtype = appl_laser    THEN
  908.                                     ;
  909.                                     ; It is an Apple LaserWriter Device.
  910.                                     ;
  911.             dc.B    $FE,$20,$27,$20    ; Group 0                        (LONG)
  912.             dc.B    $00,$00,$00,$00    ; Group 1                        (LONG)
  913.             dc.B    $00,$00,$00,$00    ; Group 2                        (LONG)
  914.             dc.B    $00,$00,$00,$00    ; Group 3                        (LONG)
  915.             dc.B    $00,$00,$00,$00    ; Group 4                        (LONG)
  916.             dc.B    $00,$00,$00,$00    ; Group 5                        (LONG)
  917.             dc.B    $00,$00,$00,$00    ; Group 6                        (LONG)
  918.             dc.B    $00,$00,$00,$00    ; Group 7                        (LONG)
  919.             ENDIF
  920.  
  921. ;-------------------------------------------------------------------------------
  922.  
  923.                                     ;
  924.                                     ; SCSI Manager Call PList
  925.                                     ;
  926.             dc.w    $0000            ; Same as our Slot Number        (WORD)
  927.             dc.w    scsi_dtype        ; Same as our Unit Number        (WORD)            
  928.             dc.w    $0000            ; Version of call issued        (WORD)
  929.             dc.w    $0000            ; Flags from Command Table        (WORD)            
  930.             dc.w    $0000            ; Time Out Factor * xxx ms        (WORD)
  931.                                     ; Completion Routine Pointer    (LONG)
  932.             dc.l    dib.complet\
  933.                     +default_dib
  934.                                     ; Pointer to Command Packet        (LONG)
  935.             dc.l    dib.scsicmd\
  936.                     +default_dib            
  937.                                     ; Ptr to Send/R'cv Structure    (LONG)
  938.             dc.l    dib.trx_buff\
  939.                     +default_dib
  940.             dc.l    $00000000        ; Users Send/R'cv Length        (LONG)
  941.                                     ; Pointer to Status Structure    (LONG)
  942.             dc.l    auto_sense_data
  943.  
  944.             dc.l    $00000000        ; Reserved space 1                (LONG)
  945.  
  946.             dc.l    $00000000        ; Reserved space 2                (LONG)
  947.                                     ;
  948.                                     ; SCSI Command Packet
  949.                                     ;
  950.             dcb.b    12,$00            ; Room for any SCSI Command        (BYTES)
  951.                                     ;
  952.                                     ; SCSI Manager Device Send/R'cv Buffers List
  953.                                     ;
  954.             dc.l    $00000000        ; Users Send Buffer                (LONG)
  955.             dc.l    $00000000        ; Request cnt for this buffer    (LONG)
  956.             dc.l    $00000000        ; Offset for next pass            (LONG)
  957.             dc.l    $00000000        ; Null                            (LONG)
  958.             dc.l    $00000000        ; Null                            (LONG)
  959.             dc.l    $00000000        ; Null                            (LONG)
  960.             dc.l    $00000000        ; Null                            (LONG)
  961.             dc.l    $00000000        ; Null                            (LONG)
  962.             dcb.l    4,$00000000        ; Reserved Space * 4 for future    (LONG)
  963.                                     ;
  964.                                     ; Device Busy and other Flags    (WORD)
  965.                                     ;
  966.             dc.w    wait_mode++\    ; Wait Mode is default
  967.                     cold_dib        ; and they start cold.
  968.  
  969.                                     ;
  970.                                     ; Completion Routine for this DIB.
  971.                                     ; This takes the remaining space in
  972.                                     ; the allocated RAM.  Any routine can
  973.                                     ; be placed here but must never go
  974.                                     ; beyond offset $FF
  975.                                     ;
  976.             jsl        g_dib_ptr
  977.             pei        scsi_zp0
  978.             pei        scsi_zp1
  979.             stx        <scsi_zp0
  980.             sty        <scsi_zp1
  981.             ldy        #dib.dvcflag
  982.             lda        #int_busy--\
  983.                     $ffff
  984.             and        [scsi_zp0],y
  985.             sta        [scsi_zp0],y
  986.             pla
  987.             sta        <scsi_zp1
  988.             pla
  989.             sta        <scsi_zp0
  990.             clc
  991.             lda        #null
  992.             rtl
  993. @end        equ        *
  994.  
  995. ;-------------------------------------------------------------------------------
  996.  
  997.             IF        @end-default_dib = dib_size    THEN
  998.                                     ;
  999.                                     ; Perfect Fit of DIB
  1000.                                     ;
  1001.             ENDIF
  1002.  
  1003. ;-------------------------------------------------------------------------------
  1004.  
  1005.             IF        @end-default_dib>dib_size    THEN
  1006.                                     ;
  1007.                                     ; It's too long.  Force an error
  1008.                                     ;
  1009.             bad     dib length
  1010.             ENDIF
  1011.  
  1012. ;-------------------------------------------------------------------------------
  1013.  
  1014.             IF        @end-default_dib<dib_size    THEN
  1015.                                     ;
  1016.                                     ; Too Small.     Pad to fit.
  1017.                                     ;
  1018.             dcb.b    default_dib+$100-@end,$00
  1019.             ENDIF
  1020.  
  1021. ;-------------------------------------------------------------------------------
  1022.  
  1023.             ENDP
  1024.  
  1025.             EJECT
  1026.             
  1027. ;*******************************************************
  1028. ;
  1029. ;    This area contains the format options for the device
  1030. ;    that this driver was written for.  It's construction
  1031. ;    is as defined in the SCSI Device Driver ERS.
  1032. ;
  1033. ;*******************************************************
  1034.  
  1035.                     EXPORT    format_options        
  1036. format_options        PROC
  1037.  
  1038. ;-------------------------------------------------------------------------------
  1039.  
  1040.         IF        scsi_dtype = direct_acc    THEN
  1041.  
  1042.                 EXPORT        display_cnt
  1043.                 EXPORT        current_fmt
  1044.                 EXPORT        opt1_blk_cnt
  1045.                 EXPORT        opt1_blk_siz
  1046.                 EXPORT        opt1_interleave
  1047.                 EXPORT        opt1_med_siz
  1048.                 EXPORT        opt2_blk_cnt
  1049.                 EXPORT        opt2_blk_siz
  1050.                 EXPORT        opt2_interleave
  1051.                 EXPORT        opt2_med_siz
  1052.                 EXPORT        opt3_blk_cnt
  1053.                 EXPORT        opt3_blk_siz
  1054.                 EXPORT        opt3_interleave
  1055.                 EXPORT        opt3_med_siz
  1056.                                         ;
  1057.                                         ; Direct Access Device format options.
  1058.                                         ;
  1059.                 dc.w    $0003            ;Number of entries
  1060. display_cnt        dc.w    $0002            ;Number of display entries
  1061.                 dc.w    $0001            ;Recommended Default entry
  1062. current_fmt        dc.w    $0001            ;Current Format
  1063.  
  1064.                 dc.w    $0001            ;Refnum = Option #1
  1065.                 dc.w    $0002            ;Linkref = Option #2
  1066.                 dc.w    $0008            ;Universal format
  1067.                                         ;Size in megabytes
  1068. opt1_blk_cnt    dc.l    null            ;Block Count Option #1
  1069. opt1_blk_siz    dc.w    $0200            ;Block Size Option #1
  1070. opt1_interleave    dc.w    $0001            ;Interleave = 1:1
  1071. opt1_med_siz    dc.w    null            ;Media size in megabytes
  1072.  
  1073.                 dc.w    $0002            ;Refnum = Option #2
  1074.                 dc.w    $0000            ;Linkref = Option #0
  1075.                 dc.w    $0008            ;Universal format
  1076.                                         ;Size in megabytes
  1077. opt2_blk_cnt    dc.l    null            ;Block Count Option #2
  1078. opt2_blk_siz    dc.w    $0200            ;Block Size Option #2
  1079. opt2_interleave    dc.w    $0002            ;Interleave = 2:1
  1080. opt2_med_siz    dc.w    null            ;Media size in megabytes
  1081.                                         ;
  1082.                                         ; Used only if the device is currently
  1083.                                         ; formatted to 532 byte blocks.
  1084.                                         ;
  1085.                 dc.w    $0003            ;Refnum = Option #3
  1086.                 dc.w    $0000            ;Linkref = Option #0
  1087.                 dc.w    $0008            ;Universal format
  1088.                                         ;Size in megabytes
  1089. opt3_blk_cnt    dc.l    null            ;Block Count Option #3
  1090. opt3_blk_siz    dc.w    $0214            ;Block Size Option #3
  1091. opt3_interleave    dc.w    $0005            ;Interleave = 5:1
  1092. opt3_med_siz    dc.w    null            ;Media size in megabytes
  1093.  
  1094.                 ENDIF
  1095.  
  1096. ;-------------------------------------------------------------------------------
  1097.  
  1098.                 ENDP
  1099.             
  1100.                 EJECT
  1101.             
  1102. ;*******************************************************
  1103. ;
  1104. ;    All the Data for this driver is maintained in this
  1105. ;    procedure.  This is to allow easy future conversion
  1106. ;    to ROM code if that is ever needed.  In order for
  1107. ;    this to work, the following should be changed to a
  1108. ;    RECORD structure and then the appropriate space
  1109. ;    requested from the memory manager and used as a
  1110. ;    temporary Direct Page space.  The template created
  1111. ;    by changing this to a RECORD would then be used to
  1112. ;    overlay the RAM supplied by the memory manager.
  1113. ;
  1114. ;*******************************************************
  1115.  
  1116.                 EXPORT    drvrdata        
  1117. drvrdata        PROC
  1118.             
  1119.                 EXPORT    direct_page
  1120. direct_page        dc.w    null                ;Our Direct Page Start Address
  1121.  
  1122.                 EXPORT    exit_dpage
  1123. exit_dpage        dc.w    null                ;Our Direct Page Start Address
  1124.  
  1125.                 EXPORT    gsos_dpage
  1126. gsos_dpage        dc.w    null                ;GS/OS Direct Page Start Address
  1127.  
  1128.                 EXPORT    valid
  1129. valid            dc.w    null                ;Saved ZP Validity flag
  1130.  
  1131.                 EXPORT    saved_zp
  1132. saved_zp        dcb.b    end_our_zp-\        ;Saved GS/OS ZP Slept here
  1133.                         start_our_zp,null
  1134.  
  1135.                                             ;
  1136.                                             ;Data for the GET LAST RESULT Call
  1137.                                             ;
  1138.                 EXPORT    lst_rslt_ec
  1139.                 EXPORT    lst_rslt_id
  1140.                 EXPORT    lst_rslt_stat
  1141.                 EXPORT    lst_rslt_skey        ;*** DO NOT SEPERATE THESE LABLES ***
  1142.                 EXPORT    lst_rslt_info
  1143.                 EXPORT    lst_rslt_rqlen
  1144.                 EXPORT    lst_rslt_scode
  1145.  
  1146. lst_rslt_ec        dc.w    null                ;GS/OS Error Code
  1147. lst_rslt_id        dc.w    null                ;Device ID Number
  1148. lst_rslt_stat    dc.w    null                ;Status Code
  1149. lst_rslt_skey    dc.w    null                ;Sense Key
  1150. lst_rslt_info    dc.l    null                ;Information Bytes
  1151. lst_rslt_rqlen    dc.w    null                ;Data Length
  1152. lst_rslt_scode    dc.w    null                ;Additional Sense Code
  1153.  
  1154.                 EXPORT    master_uid
  1155. master_uid        dc.w    $0000                ;Master MM User ID
  1156.  
  1157.                 EXPORT    scsi_uid
  1158. scsi_uid        dc.w    $0000                ;Our MM User ID
  1159.  
  1160.                 EXPORT    page_cnt
  1161. page_cnt        dc.w    $0000                ;Page Count for Remaining free RAM.
  1162.  
  1163.                 EXPORT    hndl_offset
  1164. hndl_offset        dc.w    $0000                ;Handle offset in new memory structure.
  1165.  
  1166.                 EXPORT    buff_len
  1167. buff_len        dc.w    $0000                ;Length of Requested Memory
  1168.  
  1169.                 EXPORT    scratch0
  1170. scratch0        dc.w    $0000                ;Scratch Working Area
  1171.  
  1172.                 EXPORT    scratch1
  1173. scratch1        dc.w    $0000                ;Scratch Working Area
  1174.  
  1175.                 EXPORT    scratch2
  1176. scratch2        dc.w    $0000                ;Scratch Working Area
  1177.  
  1178.                 EXPORT    scratch3
  1179. scratch3        dc.w    $0000                ;Scratch Working Area
  1180.  
  1181.                 EXPORT    call_type
  1182. call_type        dc.w    $0000                ;Current SCSI Command Type
  1183.  
  1184.                 EXPORT    curr_hndl
  1185. curr_hndl        dc.l    $00000000
  1186.  
  1187.                 EXPORT    main_caller
  1188. main_caller        dc.w    $0000
  1189.  
  1190.                 EXPORT    ram_page_cnt
  1191. ram_page_cnt    dc.w    $0000
  1192.  
  1193.                 EXPORT    tot_dib_cnt
  1194. tot_dib_cnt        dc.w    $0000
  1195.  
  1196.                 EXPORT    active_starts
  1197. active_starts    dc.w    $0000
  1198.                         
  1199.                 EXPORT    t_dvc_blocks
  1200. t_dvc_blocks    dc.l    null                ; Storage for the total block count
  1201.  
  1202.                 EXPORT    dvc_ram                ;Start of the device buffer plus
  1203. dvc_ram            dc.l    null                ;the handle space
  1204.  
  1205.                 EXPORT    sense_data
  1206. sense_data        dcb.b    one_page,null
  1207.  
  1208.                 EXPORT    auto_sense_data
  1209. auto_sense_data    dcb.b    one_page,null
  1210.  
  1211.                 EXPORT    format_data
  1212.                 EXPORT    verify_part
  1213. verify_part
  1214. format_data        dcb.b    one_page,null
  1215.  
  1216.                 EXPORT    dvc_count        ;Number of devices returned by the
  1217. dvc_count        dc.w    null            ;SCSI Manager get devices call.
  1218.                                         ;
  1219.                                         ; Flag to indicate whether this call
  1220.                                         ; came as a STARTUP or a rebuild of
  1221.                                         ; the DIBs.
  1222.                                         ;
  1223.                 EXPORT    rebuild
  1224. rebuild            dc.w    null
  1225.  
  1226.                 EXPORT    dpi_overide
  1227. dpi_overide        dc.w    null
  1228.  
  1229.                 EXPORT    trash_it
  1230. trash_it        dc.w    null
  1231.  
  1232.                 EXPORT    part_num
  1233. part_num        dc.w    null
  1234.  
  1235.                 EXPORT    vPart_cnt
  1236. vPart_cnt        dc.w    null
  1237.  
  1238.                 EXPORT    part_cnt
  1239. part_cnt        dc.w    null
  1240.  
  1241.                 EXPORT    first_time
  1242. first_time        dc.w    null
  1243.  
  1244.                 EXPORT    only_one
  1245. only_one        dc.w    null
  1246.  
  1247.                 EXPORT    result
  1248. result            dc.l    null            ;Result of Divide routine
  1249.  
  1250.                 EXPORT    divend
  1251. divend            dc.l    null            ;Dividend for the division
  1252.  
  1253.                 EXPORT    divsor
  1254. divsor            dc.w    null            ;Divisor for the division
  1255.  
  1256.                 EXPORT    max_blk_cnt
  1257. max_blk_cnt        dc.l    null            ;Maximum Result allowed
  1258.  
  1259.                 EXPORT    m_rslt
  1260. m_rslt            dc.l    null            ;Result of Multiply routine
  1261.  
  1262.                 EXPORT    m_blk_cnt
  1263. m_blk_cnt        dc.l    null            ;Block Count for the Multiply
  1264.  
  1265.                 EXPORT    m_blk_size
  1266. m_blk_size        dc.w    null            ;Block Size for the Multiply
  1267.  
  1268.                 EXPORT    timeout_flag
  1269. timeout_flag    dc.w    null            ;Timeout based on block count flag
  1270.  
  1271.                 EXPORT    time_cnt
  1272. time_cnt        dc.l    null            ;Timeout Calculation Area.
  1273.                                         ;
  1274.                                         ; DIB Data Structure Pointer
  1275.                                         ;
  1276.                 EXPORT    dib_data_struct
  1277. dib_data_struct    dc.l    null
  1278.                                         ;
  1279.                                         ; Data Chaining Flag
  1280.                                         ;
  1281.                 EXPORT        uses_dc
  1282. uses_dc            dc.w    null
  1283.                                         ;
  1284.                                         ; Data Areas for the Main Driver.
  1285.                                         ;
  1286.                 EXPORT    f_partition
  1287. f_partition        dc.w    null            ;Get the partition call flag.
  1288.  
  1289.                 EXPORT    internal        ;Internally generated command if
  1290. internal        dc.w    null            ;bit 15 is set.
  1291.  
  1292.                 EXPORT    disk_switch        ;Command requires a Disk Switch if
  1293. disk_switch        dc.w    null            ;bit 15 is set.
  1294.  
  1295.                 EXPORT    scsi_mgrnum
  1296. scsi_mgrnum        dc.w    null                ;SCSI Manager Number for S_DISPATCH
  1297.  
  1298.                 EXPORT    manager_cmd
  1299. manager_cmd        dc.w    null            ;SCSI Manager Command Number
  1300.  
  1301.                 EXPORT    cur_cmd
  1302. cur_cmd            dc.w    null            ;Current SCSI Command Number
  1303.  
  1304.                 EXPORT    cur_group
  1305. cur_group        dc.w    null            ;Current SCSI Command Group
  1306.  
  1307.                 EXPORT    trans_src
  1308. trans_src        dc.w    null            ;Source Command Data Offset
  1309.  
  1310.                 EXPORT    trans_dest
  1311. trans_dest        dc.w    null            ;Destination Command Data Offset
  1312.  
  1313.                 EXPORT    p_block_num
  1314. p_block_num        dc.l    null            ;Temp location for block offset.
  1315.  
  1316.                 EXPORT    killer_blk
  1317. killer_blk        dc.l    null            ;Temp location for block offset.
  1318.  
  1319.                 EXPORT    temp_acc
  1320. temp_acc        dc.w    null            ;Temporary Accumulator
  1321.  
  1322.                 EXPORT    temp_x
  1323. temp_x            dc.w    null            ;Temporary X Register
  1324.  
  1325.                 EXPORT    temp_y
  1326. temp_y            dc.w    null            ;Temporary Y Register
  1327.  
  1328.                 EXPORT    temp_len
  1329. temp_len        dc.w    null            ;Temporary Loop Length
  1330.  
  1331.                 EXPORT    trans_flag
  1332. trans_flag        dc.w    null            ;SCSI Translation Flags.
  1333.  
  1334.                 EXPORT    new_dib
  1335. new_dib            dc.w    null            ;Building a new dib flag.
  1336.  
  1337.                 EXPORT    pdi_flag
  1338. pdi_flag        dc.w    null            ;Post Driver Install is Active
  1339.  
  1340.                 EXPORT    new_list
  1341. new_list        dc.w    null            ;Post Driver List Active Flag
  1342.  
  1343.                 EXPORT    new_dib_cnt
  1344. new_dib_cnt        dc.l    null            ;Number of new devices to startup
  1345.  
  1346.                 EXPORT    new_dib_list
  1347.                                         ;List of DIB ptrs for the new devices
  1348. new_dib_list    dcb.l    max_partitions,0
  1349.  
  1350.                 ENDP
  1351.  
  1352.                 END
  1353.             
  1354.                 EJECT
  1355.             
  1356.